/*
 * @Author: luoqi
 * @Date: 2022-04-04 13:44:45
 * @LastEditors: luoqi
 * @LastEditTime: 2022-04-13 22:19:27
 * @Description: 
 */
const proxy = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(proxy.createProxyMiddleware('/upload', { 
    target: "https://bucket-cz.oss-cn-chengdu.aliyuncs.com",
    secure: false,
    changeOrigin: true,
    pathRewrite: {
                 "/upload": "" // 把/api 变成空
             }

 })
);
  app.use(proxy.createProxyMiddleware('/api', { 
       target: "http://118.31.71.7:8090",
       secure: false,
       changeOrigin: true,
       pathRewrite: {
                    "^/api": "/" // 把/api 变成空
                }
 
    })
  );

};